/*
 * @(#)CalendarRecur.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.calendar.bean;

import java.sql.Timestamp;

import com.dcivision.framework.bean.AbstractBaseObject;

/**
  CalendarRecur.java

  This class is the serializable bean reflecting business logic uses.

    @author           Tony Chen
    @company          DCIVision Limited
    @creation date    01/12/2003
    @version          $Revision: 1.5 $
*/

public class CalendarRecur extends AbstractBaseObject {

  public static final String REVISION = "$Revision: 1.5 $";

  static final long serialVersionUID = -5105812839695220110L;

  public static final String IS_RECUR_EVENT = "Y";
  public static final String RECUR_TYPE_A = "A";
  public static final String RECUR_TYPE_B = "B";

  public static final String REPEAT_EVENT_EVERY = "1";
  public static final String REPEAT_EVENT_EVERY_OTHER = "2";
  public static final String REPEAT_EVENT_EVERY_THIRD = "3";
  public static final String REPEAT_EVENT_EVERY_FOURTH = "4";

  public static final String REPEAT_BY_DAY = "D";
  public static final String REPEAT_BY_WEEK = "W";
  public static final String REPEAT_BY_MONTH = "M";
  public static final String REPEAT_BT_YEAR = "Y";

  public static final String OCCUR_SEQ_FIRST = "1";
  public static final String OCCUR_SEQ_SECOND = "2";
  public static final String OCCUR_SEQ_THIRD = "3";
  public static final String OCCUR_SEQ_FOURTH = "4";
  public static final String OCCUR_SEQ_LAST = "9";

  public static final String OCCUR_MONTH_ONE = "1";
  public static final String OCCUR_MONTH_TWO = "2";
  public static final String OCCUR_MONTH_THREE = "3";
  public static final String OCCUR_MONTH_FOUR = "4";
  public static final String OCCUR_MONTH_SIX = "6";
  public static final String OCCUR_MONTH_TWELVE = "12";


  private Integer calendarID = null;
  private Timestamp startDate = null;
  private Timestamp endDate = null;
  private Integer repeatTimes = null;
  private String recurType = null;
  private Integer repeatOn = null;
  private String repeatType = null;
  private String repeatTypeDay = null;
  private Integer occurType = null;
  private Integer occurWeekDay = null;
  private Integer occurMonth = null;

  public CalendarRecur() {
    super();
  }

  public Integer getCalendarID() {
    return(this.calendarID);
  }

  public void setCalendarID(Integer calendarID) {
    this.calendarID = calendarID;
  }

  public Timestamp getStartDate() {
    return(this.startDate);
  }

  public void setStartDate(Timestamp startDate) {
    this.startDate = startDate;
  }

  public Timestamp getEndDate() {
    return(this.endDate);
  }

  public void setEndDate(Timestamp endDate) {
    this.endDate = endDate;
  }

  public Integer getRepeatTimes() {
    return(this.repeatTimes);
  }

  public void setRepeatTimes(Integer repeatTimes) {
    this.repeatTimes = repeatTimes;
  }

  public String getRecurType() {
    return(this.recurType);
  }

  public void setRecurType(String recurType) {
    this.recurType = recurType;
  }

  public Integer getRepeatOn() {
    return(this.repeatOn);
  }

  public void setRepeatOn(Integer repeatOn) {
    this.repeatOn = repeatOn;
  }

  public String getRepeatType() {
    return(this.repeatType);
  }

  public void setRepeatType(String repeatType) {
    this.repeatType = repeatType;
  }

  public String getRepeatTypeDay() {
    return(this.repeatTypeDay);
  }

  public void setRepeatTypeDay(String repeatTypeDay) {
    this.repeatTypeDay = repeatTypeDay;
  }

  public Integer getOccurType() {
    return(this.occurType);
  }

  public void setOccurType(Integer occurType) {
    this.occurType = occurType;
  }

  public Integer getOccurWeekDay() {
    return(this.occurWeekDay);
  }

  public void setOccurWeekDay(Integer occurWeekDay) {
    this.occurWeekDay = occurWeekDay;
  }

  public Integer getOccurMonth() {
    return(this.occurMonth);
  }

  public void setOccurMonth(Integer occurMonth) {
    this.occurMonth = occurMonth;
  }

  //---------------------add by Tony---------------
  public String toString() {
        return(this.getClass().getName() + "[id:" + toString(id) + "|calendarID:" + toString(calendarID) + "|startDate:" + toString(startDate) + "|endDate:" + toString(endDate) + "|repeatTimes:" + toString(repeatTimes) + "|recurType:" + toString(recurType) + "|repeatOn:" + toString(repeatOn) + "|repeatType:" + toString(repeatType) + "|repeatTypeDay:" + toString(repeatTypeDay) + "|occurType:" + toString(occurType) + "|occurWeekDay:" + toString(occurWeekDay) + "|occurMonth:" + toString(occurMonth) + "|recordStatus:" + toString(recordStatus) + "|creatorID:" + toString(creatorID) + "|createDate:" + toString(createDate) + "|updaterID:" + toString(updaterID) + "|updateDate:" + toString(updateDate) + "|creatorName:" + toString(creatorName) + "|updaterName:" + toString(updaterName) + "]");
    }

    public Object clone() {
        CalendarRecur obj = new CalendarRecur();
        obj.setID(this.getID());
        obj.setCalendarID(this.getCalendarID());
        obj.setStartDate(this.getStartDate());
        obj.setEndDate(this.getEndDate());
        obj.setRepeatTimes(this.getRepeatTimes());
        obj.setRecurType(this.getRecurType());
        obj.setRepeatOn(this.getRepeatOn());
        obj.setRepeatType(this.getRepeatType());
        obj.setRepeatTypeDay(this.getRepeatTypeDay());
        obj.setOccurType(this.getOccurType());
        obj.setOccurWeekDay(this.getOccurWeekDay());
        obj.setOccurMonth(this.getOccurMonth());
        obj.setRecordStatus(this.getRecordStatus());
        obj.setCreatorID(this.getCreatorID());
        obj.setCreateDate(this.getCreateDate());
        obj.setUpdaterID(this.getUpdaterID());
        obj.setUpdateDate(this.getUpdateDate());
        obj.setCreatorName(this.getCreatorName());
        obj.setUpdaterName(this.getUpdaterName());
        return(obj);
    }

    public boolean equals(Object obj) {
        return(obj != null && obj.getClass().getName().equals(this.getClass().getName()) && ((AbstractBaseObject)obj).getID() != null && ((AbstractBaseObject)obj).getID().equals(this.getID()));
    }


}
